<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>天翼云 WebDAV 服务 - 功能简介</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }
        
        .container {
            max-width: 900px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.15);
            overflow: hidden;
        }
        
        .hero {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
            padding: 60px 40px;
            text-align: center;
            position: relative;
        }
        
        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
            opacity: 0.3;
        }
        
        .hero-content {
            position: relative;
            z-index: 1;
        }
        
        .hero h1 {
            font-size: 3rem;
            font-weight: 700;
            margin-bottom: 20px;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        
        .hero p {
            font-size: 1.2rem;
            opacity: 0.9;
            margin-bottom: 30px;
        }
        
        .service-links {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 30px;
        }
        
        .service-link {
            display: block;
            padding: 15px 20px;
            background: rgba(255,255,255,0.2);
            color: white;
            text-decoration: none;
            border-radius: 10px;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.3);
        }
        
        .service-link:hover {
            background: rgba(255,255,255,0.3);
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        }
        
        .service-link .icon {
            font-size: 1.5rem;
            margin-bottom: 5px;
            display: block;
        }
        
        .service-link .title {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 3px;
        }
        
        .service-link .desc {
            font-size: 0.85rem;
            opacity: 0.8;
        }
        
        .content {
            padding: 50px 40px;
        }
        
        .section {
            margin-bottom: 50px;
        }
        
        .section h2 {
            font-size: 2rem;
            color: #2c3e50;
            margin-bottom: 20px;
            position: relative;
            padding-bottom: 10px;
        }
        
        .section h2::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 50px;
            height: 3px;
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            border-radius: 2px;
        }
        
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            margin-top: 30px;
        }
        
        .feature {
            padding: 30px;
            background: #f8f9fa;
            border-radius: 15px;
            text-align: center;
            transition: all 0.3s ease;
            border: 1px solid #e9ecef;
        }
        
        .feature:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.1);
            background: white;
        }
        
        .feature .icon {
            font-size: 3rem;
            margin-bottom: 20px;
            color: #4facfe;
        }
        
        .feature h3 {
            font-size: 1.3rem;
            color: #2c3e50;
            margin-bottom: 15px;
        }
        
        .feature p {
            color: #6c757d;
            line-height: 1.6;
        }
        
        .connection-info {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 40px;
            border-radius: 15px;
            margin-top: 30px;
        }
        
        .connection-info h3 {
            font-size: 1.5rem;
            margin-bottom: 20px;
            text-align: center;
        }
        
        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
        }
        
        .info-item {
            background: rgba(255,255,255,0.1);
            padding: 20px;
            border-radius: 10px;
            backdrop-filter: blur(10px);
        }
        
        .info-item strong {
            display: block;
            margin-bottom: 8px;
            font-size: 1.1rem;
        }
        
        .info-item code {
            background: rgba(0,0,0,0.2);
            padding: 5px 10px;
            border-radius: 5px;
            font-family: 'Courier New', monospace;
            word-break: break-all;
        }
        
        .platforms {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 30px;
        }
        
        .platform {
            text-align: center;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 10px;
            transition: all 0.3s ease;
        }
        
        .platform:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        
        .platform .icon {
            font-size: 2.5rem;
            margin-bottom: 15px;
        }
        
        .platform h4 {
            color: #2c3e50;
            margin-bottom: 10px;
        }
        
        .platform p {
            color: #6c757d;
            font-size: 0.9rem;
        }
        
        .command-manual {
            background: #f8f9fa;
            border-radius: 15px;
            padding: 30px;
            margin-top: 20px;
        }
        
        .command-section {
            margin-bottom: 30px;
        }
        
        .command-section:last-child {
            margin-bottom: 0;
        }
        
        .command-section h3 {
            color: #2c3e50;
            font-size: 1.3rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #e9ecef;
        }
        
        .command-item {
            background: white;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            border-left: 4px solid #4facfe;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
        }
        
        .command-item:hover {
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            transform: translateX(5px);
        }
        
        .command-item:last-child {
            margin-bottom: 0;
        }
        
        .command-item code {
            background: #2c3e50;
            color: #4facfe;
            padding: 8px 12px;
            border-radius: 5px;
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
            font-size: 0.9rem;
            display: block;
            margin-bottom: 8px;
            word-break: break-all;
        }
        
        .command-item p {
            color: #6c757d;
            margin: 0;
            font-size: 0.9rem;
            line-height: 1.4;
        }
        
        .footer {
            background: #2c3e50;
            color: white;
            text-align: center;
            padding: 30px;
        }
        
        .footer p {
            opacity: 0.8;
        }
        
        @media (max-width: 768px) {
            .hero h1 {
                font-size: 2rem;
            }
            
            .hero p {
                font-size: 1rem;
            }
            
            .content {
                padding: 30px 20px;
            }
            
            .hero {
                padding: 40px 20px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="hero">
            <div class="hero-content">
                <h1>🌐 天翼云 WebDAV 服务</h1>
                <p>基于 FastAPI + WsgiDAV 的高性能统一服务平台</p>
                
                <div class="service-links">
                    <a href="{{ webdav_path }}/" class="service-link">
                        <span class="icon">📁</span>
                        <div class="title">WebDAV 服务</div>
                        <div class="desc">文件存储与同步</div>
                    </a>
                    <a href="{{ api_docs }}" class="service-link">
                        <span class="icon">📖</span>
                        <div class="title">API 文档</div>
                        <div class="desc">接口说明与测试</div>
                    </a>
                    <a href="{{ admin_panel }}" class="service-link">
                        <span class="icon">⚙️</span>
                        <div class="title">管理面板</div>
                        <div class="desc">用户与系统管理</div>
                    </a>
                    <a href="/api/v1/status" class="service-link">
                        <span class="icon">🔧</span>
                        <div class="title">API 接口</div>
                        <div class="desc">RESTful API 服务</div>
                    </a>
                </div>
            </div>
            
            <div class="section">
                <h2>📖 命令使用手册</h2>
                <div class="command-manual">
                    <div class="command-section">
                        <h3>🚀 服务启动</h3>
                        <div class="command-item">
                            <code>python main.py start</code>
                            <p>启动 WebDAV 服务（默认 FastAPI 模式）</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py start --debug</code>
                            <p>调试模式启动服务</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py start --host 0.0.0.0 --port 8080</code>
                            <p>指定主机地址和端口启动</p>
                        </div>
                    </div>
                    
                    <div class="command-section">
                        <h3>👤 账号管理</h3>
                        <div class="command-item">
                            <code>python main.py account list</code>
                            <p>列出所有云盘账号</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py account add --username 用户名 --password 密码</code>
                            <p>添加新的云盘账号</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py account remove --id 账号ID</code>
                            <p>删除指定的云盘账号</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py account test --id 账号ID</code>
                            <p>测试指定账号的连接状态</p>
                        </div>
                    </div>
                    
                    <div class="command-section">
                        <h3>🗄️ 数据库管理</h3>
                        <div class="command-item">
                            <code>python main.py db init</code>
                            <p>初始化数据库结构</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py db check</code>
                            <p>检查数据库状态</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py db optimize</code>
                            <p>优化数据库性能</p>
                        </div>
                    </div>
                    
                    <div class="command-section">
                        <h3>📥 资源导入</h3>
                        <div class="command-item">
                            <code>python main.py import --account-id 1</code>
                            <p>导入指定账号的云盘资源</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py import --account-id 1 --depth 5</code>
                            <p>指定导入深度（默认3层）</p>
                        </div>
                    </div>
                    
                    <div class="command-section">
                        <h3>⚙️ 配置查看</h3>
                        <div class="command-item">
                            <code>python main.py config</code>
                            <p>显示当前配置信息</p>
                        </div>
                        <div class="command-item">
                            <code>python main.py config --verbose</code>
                            <p>显示详细配置信息</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="content">
            <div class="section">
                <h2>🚀 核心功能</h2>
                <div class="features">
                    <div class="feature">
                        <div class="icon">📂</div>
                        <h3>WebDAV 协议</h3>
                        <p>完整支持 WebDAV 协议，提供文件上传、下载、创建、删除等操作</p>
                    </div>
                    <div class="feature">
                        <div class="icon">🔐</div>
                        <h3>安全认证</h3>
                        <p>支持基本认证和用户权限管理，确保数据安全</p>
                    </div>
                    <div class="feature">
                        <div class="icon">⚡</div>
                        <h3>高性能</h3>
                        <p>基于 FastAPI 异步框架，提供高并发处理能力</p>
                    </div>
                    <div class="feature">
                        <div class="icon">🌍</div>
                        <h3>跨平台</h3>
                        <p>支持 Windows、macOS、Linux 等多种操作系统</p>
                    </div>
                    <div class="feature">
                        <div class="icon">📱</div>
                        <h3>多端同步</div>
                        <p>支持桌面客户端、移动设备和 Web 浏览器访问</p>
                    </div>
                    <div class="feature">
                        <div class="icon">🔧</div>
                        <h3>易于管理</h3>
                        <p>提供 Web 管理界面和 RESTful API 接口</p>
                    </div>
                </div>
            </div>
            
            <div class="section">
                <div class="connection-info">
                    <h3>🔗 连接信息</h3>
                    <div class="info-grid">
                        <div class="info-item">
                            <strong>服务器地址:</strong>
                            <code>http://{{ request.url.hostname }}:{{ request.url.port }}{{ webdav_path }}/</code>
                        </div>
                        <div class="info-item">
                            <strong>认证方式:</strong>
                            <code>基本认证 (用户名/密码)</code>
                        </div>
                        <div class="info-item">
                            <strong>协议支持:</strong>
                            <code>WebDAV, HTTP/HTTPS</code>
                        </div>
                        <div class="info-item">
                            <strong>端口:</strong>
                            <code>{{ request.url.port }}</code>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="section">
                <h2>💻 客户端支持</h2>
                <div class="platforms">
                    <div class="platform">
                        <div class="icon">🪟</div>
                        <h4>Windows</h4>
                        <p>文件资源管理器直接映射网络驱动器</p>
                    </div>
                    <div class="platform">
                        <div class="icon">🍎</div>
                        <h4>macOS</h4>
                        <p>Finder 中连接到服务器功能</p>
                    </div>
                    <div class="platform">
                        <div class="icon">🐧</div>
                        <h4>Linux</h4>
                        <p>支持 davfs2、Nautilus 等客户端</p>
                    </div>
                    <div class="platform">
                        <div class="icon">📱</div>
                        <h4>移动设备</h4>
                        <p>iOS、Android WebDAV 客户端应用</p>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="footer">
            <p>&copy; 2024 天翼云 WebDAV 服务 | 基于 FastAPI + WsgiDAV 构建</p>
        </div>
    </div>
</body>
</html>